package com.idealighter.game.server.db.datadb.generate.mapper;

import com.idealighter.game.server.db.datadb.generate.domain.RoomCardGroupDomain;
import com.idealighter.game.server.db.datadb.generate.domain.RoomCardGroupDomainExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface RoomCardGroupDomainMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table room_card_group
     *
     * @mbg.generated Sat Jun 23 19:49:58 CST 2018
     */
    @SelectProvider(type=RoomCardGroupDomainSqlProvider.class, method="countByExample")
    long countByExample(RoomCardGroupDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table room_card_group
     *
     * @mbg.generated Sat Jun 23 19:49:58 CST 2018
     */
    @DeleteProvider(type=RoomCardGroupDomainSqlProvider.class, method="deleteByExample")
    int deleteByExample(RoomCardGroupDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table room_card_group
     *
     * @mbg.generated Sat Jun 23 19:49:58 CST 2018
     */
    @Delete({
        "delete from room_card_group",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table room_card_group
     *
     * @mbg.generated Sat Jun 23 19:49:58 CST 2018
     */
    @Insert({
        "insert into room_card_group (group_name, owner_id, ",
        "owner_super_id, owner_player_name, ",
        "room_num, member_num, ",
        "max_member, create_time, ",
        "end_time, state)",
        "values (#{groupName,jdbcType=VARCHAR}, #{ownerId,jdbcType=BIGINT}, ",
        "#{ownerSuperId,jdbcType=BIGINT}, #{ownerPlayerName,jdbcType=VARCHAR}, ",
        "#{roomNum,jdbcType=INTEGER}, #{memberNum,jdbcType=INTEGER}, ",
        "#{maxMember,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{endTime,jdbcType=TIMESTAMP}, #{state,jdbcType=TINYINT})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(RoomCardGroupDomain record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table room_card_group
     *
     * @mbg.generated Sat Jun 23 19:49:58 CST 2018
     */
    @InsertProvider(type=RoomCardGroupDomainSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insertSelective(RoomCardGroupDomain record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table room_card_group
     *
     * @mbg.generated Sat Jun 23 19:49:58 CST 2018
     */
    @SelectProvider(type=RoomCardGroupDomainSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="group_name", property="groupName", jdbcType=JdbcType.VARCHAR),
        @Result(column="owner_id", property="ownerId", jdbcType=JdbcType.BIGINT),
        @Result(column="owner_super_id", property="ownerSuperId", jdbcType=JdbcType.BIGINT),
        @Result(column="owner_player_name", property="ownerPlayerName", jdbcType=JdbcType.VARCHAR),
        @Result(column="room_num", property="roomNum", jdbcType=JdbcType.INTEGER),
        @Result(column="member_num", property="memberNum", jdbcType=JdbcType.INTEGER),
        @Result(column="max_member", property="maxMember", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="state", property="state", jdbcType=JdbcType.TINYINT)
    })
    List<RoomCardGroupDomain> selectByExample(RoomCardGroupDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table room_card_group
     *
     * @mbg.generated Sat Jun 23 19:49:58 CST 2018
     */
    @Select({
        "select",
        "id, group_name, owner_id, owner_super_id, owner_player_name, room_num, member_num, ",
        "max_member, create_time, end_time, state",
        "from room_card_group",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="group_name", property="groupName", jdbcType=JdbcType.VARCHAR),
        @Result(column="owner_id", property="ownerId", jdbcType=JdbcType.BIGINT),
        @Result(column="owner_super_id", property="ownerSuperId", jdbcType=JdbcType.BIGINT),
        @Result(column="owner_player_name", property="ownerPlayerName", jdbcType=JdbcType.VARCHAR),
        @Result(column="room_num", property="roomNum", jdbcType=JdbcType.INTEGER),
        @Result(column="member_num", property="memberNum", jdbcType=JdbcType.INTEGER),
        @Result(column="max_member", property="maxMember", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="state", property="state", jdbcType=JdbcType.TINYINT)
    })
    RoomCardGroupDomain selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table room_card_group
     *
     * @mbg.generated Sat Jun 23 19:49:58 CST 2018
     */
    @UpdateProvider(type=RoomCardGroupDomainSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") RoomCardGroupDomain record, @Param("example") RoomCardGroupDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table room_card_group
     *
     * @mbg.generated Sat Jun 23 19:49:58 CST 2018
     */
    @UpdateProvider(type=RoomCardGroupDomainSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") RoomCardGroupDomain record, @Param("example") RoomCardGroupDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table room_card_group
     *
     * @mbg.generated Sat Jun 23 19:49:58 CST 2018
     */
    @UpdateProvider(type=RoomCardGroupDomainSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(RoomCardGroupDomain record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table room_card_group
     *
     * @mbg.generated Sat Jun 23 19:49:58 CST 2018
     */
    @Update({
        "update room_card_group",
        "set group_name = #{groupName,jdbcType=VARCHAR},",
          "owner_id = #{ownerId,jdbcType=BIGINT},",
          "owner_super_id = #{ownerSuperId,jdbcType=BIGINT},",
          "owner_player_name = #{ownerPlayerName,jdbcType=VARCHAR},",
          "room_num = #{roomNum,jdbcType=INTEGER},",
          "member_num = #{memberNum,jdbcType=INTEGER},",
          "max_member = #{maxMember,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "end_time = #{endTime,jdbcType=TIMESTAMP},",
          "state = #{state,jdbcType=TINYINT}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(RoomCardGroupDomain record);
}